﻿using UnityEngine;
using UnityEditor;
using System.Collections;
using System.Collections.Generic;
using TTGameEngine;

/*
 * SkillTLDataEditor
 *
 *
 *
 * 依赖：
 *
 * ！不写重复代码！
 * @author TTun
 * @date 7/24/2017 5:53:25 PM
 */
[CustomEditor(typeof(SkillPackage))]
public class SkillTLDataEditor : Editor {
    private SerializedObject scriptObj;
    private SkillPackage obj;
    SerializedProperty AllSkillPrefab;

    void OnEnable() {
        scriptObj = new SerializedObject(target);
        obj = target as SkillPackage;

//        AllSkillPrefab = scriptObj.FindProperty("AllSkillPrefab");

    }

    public override void OnInspectorGUI() {

        scriptObj.Update();

        base.OnInspectorGUI();
//        bool b = EditorGUILayout.PropertyField(AllSkillPrefab, true);

//
//         if(b) {
//             for(int i = 0; i < obj.AllSkillPrefab.Length; i++) {
//                 TTGameEngine.SkillPackage.SkillLoadData loadData = obj.AllSkillPrefab[i];
//                 loadData.prefabPath = AssetDatabase.GetAssetPath(loadData.prefab);
//                 SkillTL skill = loadData.prefab.GetComponent<SkillTL>();
//                 loadData.skillID = skill.SkillID;
//             }
//         }

        scriptObj.ApplyModifiedProperties();
    }

    List<GameObject> snapshotPrefabs = new List<GameObject>();
    void snapshot() {
        snapshotPrefabs.Clear();
//         for(int i = 0; i < obj.AllSkillPrefab.Length; i++) {
//             snapshotPrefabs.Add();
//         }

    }
}